Empty object not subtype of object with index signature#50013
Empty object not subtype of object with index signature#50013ahejlsberg wants to merge 3 commits intomainfrom
Conversation
|
@typescript-bot test this |
|
Heya @ahejlsberg, I've started to run the extended test suite on this PR at c7b2942. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at c7b2942. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the abridged perf test suite on this PR at c7b2942. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at c7b2942. You can monitor the build here. Update: The results are in! |
|
@ahejlsberg Here they are:Comparison Report - main..50013
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Heya @ahejlsberg, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
|
@ahejlsberg |
| >values3 : any[] | ||
| >Object.values({}) : any[] |
There was a problem hiding this comment.
q: is this a desired change?
|
Closing in favor of #50044. |
This PR tightens the subtype relation such that a non-fresh
{}is not considered a subtype of{ [x: string]: xxx }. Currently, such types are subtypes in both directions, which causes issues in narrowing.This fixes the issue reported here.